package com.energyfuture.system.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import com.energyfuture.system.service.ISysParamService;
import com.energyfuture.system.service.ISysUserService;
import com.energyfuture.system.utils.ScheduleUtils;

@Component
public class Scheduler implements CommandLineRunner {

    @Autowired
    private ISysParamService sysParamService;

    @Autowired
    private ISysUserService userService ;

    /**
     *
     * @param args
     * @throws Exception
     */
    @Override
    public void run(String... args) throws Exception {
        ScheduleUtils.start(new ScheduledTask("task1",userService,sysParamService), sysParamService.selectParam().getSearchcount());
    }
}
